/*******************************************************************************
 *
 * Copyright (c) 2004-2008 by Vivante Corp.  All rights reserved.
 *
 * The material in this file is confidential and contains trade secrets of
 * Vivante Corporation.  This is proprietary information owned by Vivante
 * Corporation.  No part of this work may be disclosed, reproduced, copied,
 * transmitted, or used in any way for any purpose, without the express
 * written permission of Vivante Corporation.
 *
 ******************************************************************************/

/*******************************************************************************
 *
 * This file is automatically generated on Mon Apr 13 01:22:32 2009
 *
 * Any changes made to this file are lost at the next compile run!
 * So better make sure you update the source .r files instead!
 *
 ******************************************************************************/

////////////////////////////////////////////////////////////////////////////////
//                             ~~~~~~~~~~~~~~~~~~~                            //
//                             Module RasterEngine                            //
//                             ~~~~~~~~~~~~~~~~~~~                            //
////////////////////////////////////////////////////////////////////////////////

// Register AQRasterControl.
// ~~~~~~~~~~~~~~~~~~~~~~~~
#define AQRasterControlRegAddrs                                           0x0380
#define AQ_RASTER_CONTROL_Address                                        0x00E00
#define AQ_RASTER_CONTROL_MSB                                                 15
#define AQ_RASTER_CONTROL_LSB                                                  0
#define AQ_RASTER_CONTROL_Count                                                1
#define AQ_RASTER_CONTROL_FieldMask                                   0x00000007
#define AQ_RASTER_CONTROL_ReadMask                                    0x00000007
#define AQ_RASTER_CONTROL_WriteMask                                   0x00000007
#define AQ_RASTER_CONTROL_ResetValue                                  0x00000001

// Enable optimized tile walking and quad walking.
#define AQ_RASTER_CONTROL_ENABLE_OPTIMIZATIONS                               0:0
#define AQ_RASTER_CONTROL_ENABLE_OPTIMIZATIONS_End                             0
#define AQ_RASTER_CONTROL_ENABLE_OPTIMIZATIONS_Start                           0
#define   AQ_RASTER_CONTROL_ENABLE_OPTIMIZATIONS_DISABLED                    0x0
#define   AQ_RASTER_CONTROL_ENABLE_OPTIMIZATIONS_ENABLED                     0x1

// If this register is set, it means the last attribute has
// 2 valid components as opposed to 4. In this case, raster
// engine does not send the invalid elements to shader
// reducing the interface cycles.
#define AQ_RASTER_CONTROL_HALF_ATTRIBUTE                                     1:1
#define AQ_RASTER_CONTROL_HALF_ATTRIBUTE_End                                   1
#define AQ_RASTER_CONTROL_HALF_ATTRIBUTE_Start                                 1
#define   AQ_RASTER_CONTROL_HALF_ATTRIBUTE_DISABLED                          0x0
#define   AQ_RASTER_CONTROL_HALF_ATTRIBUTE_ENABLED                           0x1

// Enables color and depth prefetch from render pipe 
// when there is L2 cache.
#define AQ_RASTER_CONTROL_PIXEL_PREFETCH                                     2:2
#define AQ_RASTER_CONTROL_PIXEL_PREFETCH_End                                   2
#define AQ_RASTER_CONTROL_PIXEL_PREFETCH_Start                                 2
#define   AQ_RASTER_CONTROL_PIXEL_PREFETCH_DISABLED                          0x0
#define   AQ_RASTER_CONTROL_PIXEL_PREFETCH_ENABLED                           0x1

// Register gcregMultiSampleCoords (4 in total).
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

// Each of these registers contains the 4-bit sub-pixel coordinates
// for each of the for possible jitter multi-sample shapes.

#define gcregMultiSampleCoordsRegAddrs                                    0x0384
#define GCREG_MULTI_SAMPLE_COORDS_Address                                0x00E10
#define GCREG_MULTI_SAMPLE_COORDS_MSB                                         15
#define GCREG_MULTI_SAMPLE_COORDS_LSB                                          2
#define GCREG_MULTI_SAMPLE_COORDS_Count                                        4
#define GCREG_MULTI_SAMPLE_COORDS_FieldMask                           0xFFFFFFFF
#define GCREG_MULTI_SAMPLE_COORDS_ReadMask                            0xFFFFFFFF
#define GCREG_MULTI_SAMPLE_COORDS_WriteMask                           0xFFFFFFFF
#define GCREG_MULTI_SAMPLE_COORDS_ResetValue                          0x00000000

// Sub-pixel x location for multi-sample 0.
#define GCREG_MULTI_SAMPLE_COORDS_SAMPLE0_X                                  3:0
#define GCREG_MULTI_SAMPLE_COORDS_SAMPLE0_X_End                                3
#define GCREG_MULTI_SAMPLE_COORDS_SAMPLE0_X_Start                              0

// Sub-pixel y location for multi-sample 0.
#define GCREG_MULTI_SAMPLE_COORDS_SAMPLE0_Y                                  7:4
#define GCREG_MULTI_SAMPLE_COORDS_SAMPLE0_Y_End                                7
#define GCREG_MULTI_SAMPLE_COORDS_SAMPLE0_Y_Start                              4

// Sub-pixel x location for multi-sample 1.
#define GCREG_MULTI_SAMPLE_COORDS_SAMPLE1_X                                 11:8
#define GCREG_MULTI_SAMPLE_COORDS_SAMPLE1_X_End                               11
#define GCREG_MULTI_SAMPLE_COORDS_SAMPLE1_X_Start                              8

// Sub-pixel y location for multi-sample 1.
#define GCREG_MULTI_SAMPLE_COORDS_SAMPLE1_Y                                15:12
#define GCREG_MULTI_SAMPLE_COORDS_SAMPLE1_Y_End                               15
#define GCREG_MULTI_SAMPLE_COORDS_SAMPLE1_Y_Start                             12

// Sub-pixel x location for multi-sample 2.
#define GCREG_MULTI_SAMPLE_COORDS_SAMPLE2_X                                19:16
#define GCREG_MULTI_SAMPLE_COORDS_SAMPLE2_X_End                               19
#define GCREG_MULTI_SAMPLE_COORDS_SAMPLE2_X_Start                             16

// Sub-pixel y location for multi-sample 2.
#define GCREG_MULTI_SAMPLE_COORDS_SAMPLE2_Y                                23:20
#define GCREG_MULTI_SAMPLE_COORDS_SAMPLE2_Y_End                               23
#define GCREG_MULTI_SAMPLE_COORDS_SAMPLE2_Y_Start                             20

// Sub-pixel x location for multi-sample 3.
#define GCREG_MULTI_SAMPLE_COORDS_SAMPLE3_X                                27:24
#define GCREG_MULTI_SAMPLE_COORDS_SAMPLE3_X_End                               27
#define GCREG_MULTI_SAMPLE_COORDS_SAMPLE3_X_Start                             24

// Sub-pixel y location for multi-sample 3.
#define GCREG_MULTI_SAMPLE_COORDS_SAMPLE3_Y                                31:28
#define GCREG_MULTI_SAMPLE_COORDS_SAMPLE3_Y_End                               31
#define GCREG_MULTI_SAMPLE_COORDS_SAMPLE3_Y_Start                             28

// Register gcregMultiSampleJitter.
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

// Jittering reduces multi-sample moire effect by selection one out
// of four possible multi-sample shapes for each seperate pixel
// inside a 4x4 block.

#define gcregMultiSampleJitterRegAddrs                                    0x0381
#define GCREG_MULTI_SAMPLE_JITTER_Address                                0x00E04
#define GCREG_MULTI_SAMPLE_JITTER_MSB                                         15
#define GCREG_MULTI_SAMPLE_JITTER_LSB                                          0
#define GCREG_MULTI_SAMPLE_JITTER_Count                                        1
#define GCREG_MULTI_SAMPLE_JITTER_FieldMask                           0xFFFFFFFF
#define GCREG_MULTI_SAMPLE_JITTER_ReadMask                            0xFFFFFFFF
#define GCREG_MULTI_SAMPLE_JITTER_WriteMask                           0xFFFFFFFF
#define GCREG_MULTI_SAMPLE_JITTER_ResetValue                          0x00000000

// Multi-sample shape index for 0,0 pixel.
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y0_X0                               1:0
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y0_X0_End                             1
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y0_X0_Start                           0

// Multi-sample shape index for 0,1 pixel.
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y0_X1                               3:2
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y0_X1_End                             3
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y0_X1_Start                           2

// Multi-sample shape index for 0,2 pixel.
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y0_X2                               5:4
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y0_X2_End                             5
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y0_X2_Start                           4

// Multi-sample shape index for 0,3 pixel.
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y0_X3                               7:6
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y0_X3_End                             7
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y0_X3_Start                           6

// Multi-sample shape index for 1,0 pixel.
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y1_X0                               9:8
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y1_X0_End                             9
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y1_X0_Start                           8

// Multi-sample shape index for 1,1 pixel.
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y1_X1                             11:10
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y1_X1_End                            11
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y1_X1_Start                          10

// Multi-sample shape index for 1,2 pixel.
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y1_X2                             13:12
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y1_X2_End                            13
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y1_X2_Start                          12

// Multi-sample shape index for 1,3 pixel.
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y1_X3                             15:14
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y1_X3_End                            15
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y1_X3_Start                          14

// Multi-sample shape index for 2,0 pixel.
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y2_X0                             17:16
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y2_X0_End                            17
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y2_X0_Start                          16

// Multi-sample shape index for 2,1 pixel.
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y2_X1                             19:18
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y2_X1_End                            19
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y2_X1_Start                          18

// Multi-sample shape index for 2,2 pixel.
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y2_X2                             21:20
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y2_X2_End                            21
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y2_X2_Start                          20

// Multi-sample shape index for 2,3 pixel.
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y2_X3                             23:22
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y2_X3_End                            23
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y2_X3_Start                          22

// Multi-sample shape index for 3,0 pixel.
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y3_X0                             25:24
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y3_X0_End                            25
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y3_X0_Start                          24

// Multi-sample shape index for 3,1 pixel.
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y3_X1                             27:26
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y3_X1_End                            27
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y3_X1_Start                          26

// Multi-sample shape index for 3,2 pixel.
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y3_X2                             29:28
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y3_X2_End                            29
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y3_X2_Start                          28

// Multi-sample shape index for 3,3 pixel.
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y3_X3                             31:30
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y3_X3_End                            31
#define GCREG_MULTI_SAMPLE_JITTER_JITTER_Y3_X3_Start                          30

// Register gcregCentroids (16 in total).
// ~~~~~~~~~~~~~~~~~~~~~~~

// For each enabled jitter we need up to 16 centroid locations.
// The centroid is the 'center' of the pixel based on the multi-
// sample enable bits.  4 coordinate pairs can be packed in one
// register, so we need 4 registers.  Then we have 4 possible
// different jitter shapes, so we need a total of 16 registers.

#define gcregCentroidsRegAddrs                                            0x0390
#define GCREG_CENTROIDS_Address                                          0x00E40
#define GCREG_CENTROIDS_MSB                                                   15
#define GCREG_CENTROIDS_LSB                                                    4
#define GCREG_CENTROIDS_Count                                                 16
#define GCREG_CENTROIDS_FieldMask                                     0xFFFFFFFF
#define GCREG_CENTROIDS_ReadMask                                      0xFFFFFFFF
#define GCREG_CENTROIDS_WriteMask                                     0xFFFFFFFF
#define GCREG_CENTROIDS_ResetValue                                    0x00000000

// Sub-pixel x location for centroids 0 (+0), 4 (+1), 8 (+2),
// and 12 (+3).
#define GCREG_CENTROIDS_CENTROID_X_0_4_8_12                                  3:0
#define GCREG_CENTROIDS_CENTROID_X_0_4_8_12_End                                3
#define GCREG_CENTROIDS_CENTROID_X_0_4_8_12_Start                              0

// Sub-pixel y location for centroids 0 (+0), 4 (+1), 8 (+2),
// and 12 (+3).
#define GCREG_CENTROIDS_CENTROID_Y_0_4_8_12                                  7:4
#define GCREG_CENTROIDS_CENTROID_Y_0_4_8_12_End                                7
#define GCREG_CENTROIDS_CENTROID_Y_0_4_8_12_Start                              4

// Sub-pixel x location for centroids 1 (+0), 5 (+1), 9 (+2),
// and 13 (+3).
#define GCREG_CENTROIDS_CENTROID_X_1_5_9_13                                 11:8
#define GCREG_CENTROIDS_CENTROID_X_1_5_9_13_End                               11
#define GCREG_CENTROIDS_CENTROID_X_1_5_9_13_Start                              8

// Sub-pixel y location for centroids 1 (+0), 5 (+1), 9 (+2),
// and 13 (+3).
#define GCREG_CENTROIDS_CENTROID_Y_1_5_9_13                                15:12
#define GCREG_CENTROIDS_CENTROID_Y_1_5_9_13_End                               15
#define GCREG_CENTROIDS_CENTROID_Y_1_5_9_13_Start                             12

// Sub-pixel x location for centroids 2 (+0), 6 (+1), 10 (+2),
// and 14 (+3).
#define GCREG_CENTROIDS_CENTROID_X_2_6_10_14                               19:16
#define GCREG_CENTROIDS_CENTROID_X_2_6_10_14_End                              19
#define GCREG_CENTROIDS_CENTROID_X_2_6_10_14_Start                            16

// Sub-pixel y location for centroids 2 (+0), 6 (+1), 10 (+2),
// and 14 (+3).
#define GCREG_CENTROIDS_CENTROID_Y_2_6_10_14                               23:20
#define GCREG_CENTROIDS_CENTROID_Y_2_6_10_14_End                              23
#define GCREG_CENTROIDS_CENTROID_Y_2_6_10_14_Start                            20

// Sub-pixel x location for centroids 3 (+0), 7 (+1), 11 (+2),
// and 15 (+3).
#define GCREG_CENTROIDS_CENTROID_X_3_7_11_15                               27:24
#define GCREG_CENTROIDS_CENTROID_X_3_7_11_15_End                              27
#define GCREG_CENTROIDS_CENTROID_X_3_7_11_15_Start                            24

// Sub-pixel y location for centroids 3 (+0), 7 (+1), 11 (+2),
// and 15 (+3).
#define GCREG_CENTROIDS_CENTROID_Y_3_7_11_15                               31:28
#define GCREG_CENTROIDS_CENTROID_Y_3_7_11_15_End                              31
#define GCREG_CENTROIDS_CENTROID_Y_3_7_11_15_Start                            28

